﻿using System;
using System.ComponentModel;
using System.Collections.Generic;
using System.Diagnostics;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using System.Collections.ObjectModel;


namespace ManYor
{
    public class TaskViewMode : INotifyPropertyChanged
    {
        /// <summary>
        /// 构造器
        /// </summary>
        public TaskViewMode()
        {
            this.TaskItems = new List<TaskItem>();
        }
        /// <summary>
        /// A collection for ItemViewModel objects.
        /// </summary>
        public IList<TaskItem> TaskItems { get; set; }

        public bool IsDataLoaded
        {
            get;
            private set;
        }

        /// <summary>
        /// Creates and adds a few ItemViewModel objects into the Items collection.
        /// </summary>
        public void LoadData()
        {
            string imageFolder = "Images/Task/";

            TaskItems.Add(new TaskItem()
            {
                Ico = new BitmapImage(new Uri(imageFolder + "MB_SETTING.png", UriKind.Relative)),
                Title = "系统设置",
                Content="设定系统参数、主题等内容",
                ItemType = (int)TaskType.SETTING
            });

            TaskItems.Add(new TaskItem()
            {
                Ico = new BitmapImage(new Uri(imageFolder + "MB_FAV.png", UriKind.Relative)),
                Title = "分类设置",
                Content = "设置主页显示的分类个数和类别",
                ItemType = (int)TaskType.CATEGORY
            });
            TaskItems.Add(new TaskItem()
            {
                Ico = new BitmapImage(new Uri(imageFolder + "MB_DOWN.png", UriKind.Relative)),
                Title = "下载管理",
                Content = "管理正在(已)下载的内容",
                ItemType = (int)TaskType.DOWNLOAD
            });
            TaskItems.Add(new TaskItem()
            {
                Ico = new BitmapImage(new Uri(imageFolder + "MB_INFO.png", UriKind.Relative)),
                Title = "信息 / 技术支持",
                Content = "应用程序版本和作者微博、信箱",
                ItemType = (int)TaskType.SYSINFO
            });
            this.IsDataLoaded = true;
        }

        #region INotifyPropertyChanged 成员

        public event PropertyChangedEventHandler PropertyChanged;

        #endregion

       
    }
        /// <summary>
        /// 
        /// </summary>
    public class TaskItem
    {
        /// <summary>
        /// 图标路径
        /// </summary>
        public ImageSource Ico { get; set; }
        /// <summary>
        /// 标题
        /// </summary>
        public string Title { get; set; }
        /// <summary>
        /// 说明文字
        /// </summary>
        public string Content { get; set; }
        /// <summary>
        /// 类型
        /// </summary>
        public int ItemType { get; set; }
        
    }

    /// <summary>
    /// Task类型
    /// </summary>
    public enum TaskType
    {
        /// <summary>
        /// 系统设置
        /// </summary>
        SETTING=0,   
        /// <summary>
        /// 分类
        /// </summary>
        CATEGORY=1,
        /// <summary>
        /// 下载
        /// </summary>
        DOWNLOAD=2,
        /// <summary>
        /// 系统信息
        /// </summary>
        SYSINFO =3

    }
}